package vip.web3.common.enums;

/**
 * 状态 0 未结算,  1 已结算 2 待确认 3 异常 4已退款
 *
 * aut-horlilei
 */

public enum RecordStatusEnum {

    /**
     * 未结算
     */
    INIT(0, "未结算"),

    /**
     * 已结算
     */
    CLOSE(1, "已结算"),

    /**
     * 待确认
     */
    WAIT_CONFIRM(2, "待确认"),

    /**
     * 异常
     */
    ERR(3, "异常"),

    /**
     * 异常
     */
    BACK(4, "已退款"),
    ;

    private final Integer code;
    private final String desc;

    RecordStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static RecordStatusEnum get(Integer code) {
        for (RecordStatusEnum value : values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
